package com.warrantyhotel.android.widget;

import java.util.ArrayList;

import android.content.Context;
import android.graphics.drawable.Drawable;

import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.OverlayItem;

public class PinMapOverlay extends ItemizedOverlay<OverlayItem> {
	private ArrayList<OverlayItem> mOverlays = new ArrayList<OverlayItem>();

	public PinMapOverlay(Drawable defaultMarker, Context context) {
		super(boundCenter(defaultMarker));

	}

	public void addOverlay(OverlayItem overlay) {
		mOverlays.add(overlay);
		populate();
	}

	@Override
	protected OverlayItem createItem(int i) {
		return mOverlays.get(i);
	}

	@Override
	public int size() {
		return mOverlays.size();
	}
	
	
	
	// @Override
	// public boolean onTouchEvent(MotionEvent event, MapView mapView) {
	// mapView.removeAllViews();
	// return super.onTouchEvent(event, mapView);
	// }

	@Override
	protected boolean onTap(int index) {
		// ToastUtil.showText(context, "" + index);
		return super.onTap(index);
	}

}
